<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-1.11.0.js"></script>

    <script>
        // 页面加载，绑定单击事件
        $(function () {
            $("#btn").click(function () {

                alert("hello btn");
                // 发送ajax请求
                /*              $.ajax({
                                  // 编写json格式，设置属性和值
                                  url:"user/testAjax",
                                  contentType:"application/json;charset=UTF-8",
                                  data:'{"username":"hehe","password":"123","age":30}',
                                  dataType:"json",
                                  type:"post",
                                  success:function(data){
                                      // data服务器端响应的json的数据，进行解析
                                      alert(data);
                                      alert(data.username);
                                      alert(data.password);
                                      alert(data.age);
                                  }
                              });*/

            });
        });

    </script>


</head>
<body>

<a href="hello">SpringMVC入门</a> <br>
<a href="param/test?username=test01">请求参数绑定</a> <br>
<a href="param/testServlet">Servlet原生API</a> <br>

<form action="param/save" method="post">
    姓名：<input name="username" type="text"> <br>
    密码:<input name="password" type="password"> <br>
    金额:<input name="money" type="text"> <br>
    <input type="submit" value="提交">
</form>

<button id="btn">发送ajax的请求</button>

<form action="param/file" method="post">
    <input type="file">
    <input type="submit" value="提交">
</form>
</body>
</html>
